<template>

    <div class="prePay">
        <p>
            <span></span>
            请在菜单中选择在浏览器中打开,<br>以完成支付
        </p>
        <div id="tips"></div>
    </div>

    <!-- <div @click="getReason()"></div> -->
</template>

<script>
import http from "@/assets/js/axios";
import { domain } from '@/assets/js/config'
import $ from 'jquery'
import { maskTips } from '@/assets/js/dom'
export default {
    data() {
        return {
            userInfow: '',
            userToken: '',
            postEo: {
                pay_type: 'zfb',
                amount: '',
                assetsType: 0
            }
        }
    },
    components: {

    },
    mounted() {
        this.postEo.amount = this.$route.query.amount
        this.userToken = this.$route.query.userToken
        this.postEo.assetsType = this.$route.query.assetsType
        this.getReason();
    },
    methods: {
        direct: function (val) {
            this.$router.push({ path: '/' + val });
        },
        getReason: async function () {
            // $().ready(function() {
            //var $prePay = $(".prePay");
            var $tips = $("#tips");
            var userAgent = navigator.userAgent.toLowerCase();
            //var paymentTransactionSn = ${paymentTransactionSn}
            if (/micromessenger/gi.test(userAgent)) {
                //$prePay.show();
                if (/iphone|ipad|ipod/gi.test(userAgent)) {
                    // alert("a");
                    $tips.removeClass("android").addClass("iphone");
                } else if (/android/gi.test(userAgent)) {
                    // alert("b");
                    $tips.removeClass("iphone").addClass("android");
                } else {
                    alert("设备不支持");
                }
            } else {
                // window.open("${ctxF}/user/buyVip?vipCardInfoId=${vipCardInfoId}&type=${type}&userId=${userId}&per_method=${per_method}", '_parent');
                window.open(domain + "/xshk/f/assets/recharge?token=" + this.userToken + "&pay_type=" + this.postEo.pay_type + "&amount=" + this.postEo.amount+"&assetsType="+this.postEo.assetsType, '_parent')
            }

            // });
        }
    }
}
</script>

<style  scoped>
/* .prePay {
    display: none; 
} */

.prePay p {
    margin-top: 50px;
    font-size: 14px;
    text-align: center;
    position: relative;
}

.prePay p span {
    width: 28px;
    height: 40px;
    position: absolute;
    top: -40px;
    right: 10px;
    background: url();
    background-size: contain;
}

.prePay div {
    width: 100px;
    height: 100px;
    margin: 100px auto;
}

.prePay div.iphone {
    background: url();
    background-size: contain;
}

.prePay div.android {
    background: url();
    background-size: contain;
}
</style>
